package testng;

import testng.*;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;


public class chrome2 {
	WebDriver wd;
	map m1=new map();
	
	
	@BeforeMethod
	
	public  void init_env() throws IOException {
		// TODO Auto-generated method stub
		
		
		  // 业务无关，启动配置相关代码
      //  String driverPath = new File("./").getCanonicalPath() + "/src/main/java/driver/chromedriver.exe";
      
		
		String driverpath = new File("./").getCanonicalPath() + "/src/main/java/driver/chromedriver.exe";
		System.setProperty("webdriver.chrome.driver", driverpath);
		 wd=new ChromeDriver();
		
		
	}
	
  @Test
  public void start() throws InterruptedException {
	  //WebDriver wd=new ChromeDriver();
	  
	  
	  wd.manage().window().maximize();
	  //wd.navigate().to("https://www.baidu.com");
	  wd.get(m1.url1);
	 // wd.wait(2000);
	  wd.findElement(By.linkText("地图")).click();
//	  wd.findElement(By.xpath(".//*[@id='sole-searchbox-content']/div[2]")).click();;
//	  wd.findElement(By.xpath(".//*[@id='route-searchbox-content']/div[1]/div[1]/div[1]/span")).click();
//	  
//	  wd.findElement(By.xpath(".//*[@id='route-searchbox-content']/div[2]/div/div[2]/div[1]/input")).sendKeys("省体育馆地铁站");
//	  wd.findElement(By.xpath(".//*[@id='route-searchbox-content']/div[2]/div/div[2]/div[2]/input")).sendKeys("天府广场地铁站");
//	  
//	  wd.findElement(By.xpath(".//*[@id='search-button']")).click();
//	  Thread.sleep(2000);
//	  wd.findElement(By.xpath(".//*[@id='scheme_0']/div[1]")).click();
	  
	  Thread.sleep(15000);
  
  }
  
  @AfterMethod
  
  public void close() {
	  wd.quit();
  }
}
